<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('用户地址')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list" style="display: none;">
						<ul>
							

							<li>
								用户id：<input type="text" name="userId" th:value=${userId}>
							</li>

							<li>
								：<input type="text" name="valid"/>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	       
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('UserAddress:userAddress:edit')}]];
        var removeFlag = [[${@permission.hasPermi('UserAddress:userAddress:remove')}]];
        var prefix = ctx + "UserAddress/userAddress";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "用户地址中间",
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '',
					visible: false
				},
				
				{
					field : 'realname', 
					title : '姓名',
					sortable: false
				},
				{
					field : 'mobile', 
					title : '电话号码',
					sortable: false
				},
				{
					field : 'province', 
					title : '省份',
					sortable: false
				},
				{
					field : 'city', 
					title : '城市',
					sortable: false
				},
				{
					field : 'area', 
					title : '区域',
					sortable: false
				},
				{
					field : 'address', 
					title : '详细地址',
					sortable: false
				},
				
				
				{
					field : 'school', 
					title : '校区',
					sortable: false
				},
				
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="userAddressUpdate(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
                        
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
        
	function userAddressUpdate(id) {       	
        	var options = {
   				title: "用户地址详情",
   				width: 900,
   				height: 600,
   				url: prefix + "/edit/" + id,
   				skin: 'layui-layer-gray', 
   				btn: ['关闭'],
   				yes: function (index, layero) {
   	                layer.close(index);
                }
   			};
        	$.modal.openOptions(options);
        }
    </script>
</body>
</html>